#include "restart_info.h"
// bsp
#include "bsp_store.h"
// lib
#include "debug.h"

#define APP_ERROR_ROUND     5   //设备APP错误容忍次数

restart_info_t restart_info;

const char* restart_type_table[] = {
    {"Power on"},
    {"Soft reset"},
    {"Watch dog"}
};

const char* softre_reason_table[] = {
    {"none"},
    {"server init err"},
    {"server cmd"},
    {"update cmd"},
    {"network err"},
    {"server err"},
    {"device plan"}
};

void Restart_Info_Save_Bpr(void)
{
    Store_Ins_Bpr_Write((uint8_t *)(&restart_info), sizeof(restart_info_t));
}

void Restart_Info_Read_Bpr(void)
{
    Store_Ins_Bpr_Read((uint8_t *)(&restart_info), sizeof(restart_info_t));
}
